package com.eastfair.config.api;

import com.eastfair.config.entity.DisplayLocationQuestionConfig;
import com.eastfair.config.entity.DisplayLocationQuestionnaireConfig;
import com.eastfair.core.base.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Date:2021/11/30
 * Time:9:44
 *
 * @author zjn
 */
@FeignClient(value = "config/displayLocationQuestionnaireConfig")
public interface DisplayLocationQuestionnaireConfigServiceFeign {

    /**
     * 获取问卷配置列表
     *
     * @param displayLocationQuestionnaireConfig 问卷配置列表过滤条件
     * @return
     */
    @PostMapping("/getList")
    @ApiOperation(value = "获取问卷配置列表", notes = "获取问卷配置列表")
    R<List<DisplayLocationQuestionnaireConfig>> getList(@RequestBody(required = false) DisplayLocationQuestionnaireConfig displayLocationQuestionnaireConfig);

    /**
     * 获取问卷配置
     *
     * @param flagId 标识id
     * @return
     */
    @GetMapping("/get/{flagId}")
    @ApiOperation(value = "获取问卷配置", notes = "获取问卷配置")
    R<DisplayLocationQuestionnaireConfig> getDisplayLocationQuestionnaireConfig(@PathVariable("flagId") Long flagId);

    /**
     * 新增问卷配置
     *
     * @param displayLocationQuestionnaireConfig 问卷配置实体
     * @return 是否成功
     */
    @PostMapping("/saveEntity")
    @ApiOperation(value = "新增问卷配置", notes = "新增问卷配置")
    R<Boolean> saveEntity(@RequestBody DisplayLocationQuestionnaireConfig displayLocationQuestionnaireConfig);

    /**
     * 删除问卷配置
     *
     * @param flagId 问卷配置标识id
     * @return 是否成功
     */
    @DeleteMapping("/{flagId}")
    @ApiOperation(value = "删除问卷配置", notes = "删除问卷配置")
    R<Boolean> deleteEntity(@PathVariable("flagId") Long flagId);

    /**
     * 修改问卷配置信息
     *
     * @param displayLocationQuestionnaireConfig 问卷配置信息
     * @return 是否成功
     */
    @PutMapping("/updateEntity")
    @ApiOperation(value = "修改问卷配置信息", notes = "修改问卷配置信息")
    R<Boolean> updateEntity(@RequestBody DisplayLocationQuestionnaireConfig displayLocationQuestionnaireConfig);

}

